<br /><br />
<script>var js_url="<?php echo $base_url?>";</script>
<script type="text/javascript" src="<?php echo $base_url;?>style/js/BE/admin_company.js"></script>
<script type="text/javascript" src="<?php echo $base_url;?>style/js/BE/jquery.Jcrop.min.js"></script>
  <link rel="stylesheet" href="<?php echo $base_url;?>style/css/jquery.Jcrop.css" type="text/css" />
<script type="text/javascript">

  $(function(){
		//thuc hien crop js
    $('#cropbox1').Jcrop({
      onSelect: updateCoords1,
			setSelect: [ 0, 0, <?php echo IMAGE_X_SIZE_3;?>, <?php echo IMAGE_Y_SIZE_3;?> ], //chọn sẵn vùng crop
			aspectRatio: 16 / 12
    });
  });

  function updateCoords1(c)
  {
    $('#x1').val(c.x);
    $('#y1').val(c.y);
    $('#w1').val(parseInt(c.w));
    $('#h1').val(parseInt(c.h));
		//show trên layout for preview
		$('#cropbox1_w').html(parseInt(c.w));
		$('#cropbox1_h').html(parseInt(c.h));
  };

</script>
<style type="text/css">
#target {
	background-color: #ccc;
	width: 430px;
	height: 270px;
	font-size: 24px;
	display: block;
}
</style>
<form name="trueform2" id="trueform2" method="POST" action="<?php echo $base_url;?>admin_company/company_editimages" onSubmit="return submitPost_editImages()" enctype="multipart/form-data">
<input type="hidden" name="isPost" value="1">
<table width="80%" border="0" cellspacing="1" cellpadding="0" align="center" style="margin:auto; background-color:#3D84CC;">
  <tr>
    <td colspan="2" align="left" bgcolor="#3D84CC" class="title3">&nbsp;Cập nhật Hình ảnh <?php echo $page_title;?> (crop hình từ hình gốc upload)</td>
  </tr>
  <tr>
    <td align="right" bgcolor="#FFFFFF" class="title2">&nbsp;Tiêu đề:</td>
    <td align="left" bgcolor="#FFFFFF" class="title2" style="width:860px;">
			<?php echo $company_detail[0]->company_adv_name;?>    
    </td>
  </tr>
  <tr>
    <td align="right" bgcolor="#FFFFFF" class="title2">
    &nbsp;Hình ảnh:<br> 
    <span class="note">(show trang chủ)</span></td>
    <td align="left" bgcolor="#FFFFFF" class="title2">
			<img src="<?php echo $base_url;?>style/<?php echo $company_detail[0]->img;?>" border="0" id="cropbox1"/>   
      <br>
      * Vùng chọn hiện hành: width = <span id="cropbox1_w" class="note"></span> px / height = <span id="cropbox1_h" class="note"></span> px (config : width = <?php echo IMAGE_X_SIZE_3;?> px / height = <?php echo IMAGE_Y_SIZE_3;?> px)
      <?php
				if (isset($company_detail[0]->img_thumb) && $company_detail[0]->img_thumb != "")			
				{
			?>
      <br>-------------------------------------------------------------------------------------------------------------------------------------------------<br>
      * Hình đã thumb & lưu trong database: 
      <br><img src="<?php echo $base_url;?>style/<?php echo $company_detail[0]->img_thumb;?>" border="0" id="cropbox1" style="margin-top:8px;"/> 
      <?php 
				}
			?>
    </td>
  </tr>  
  <tr>
    <td colspan="2" style="text-align:center;" bgcolor="#FFFFFF" height="30px">
    <input type="hidden" id="x1" name="x1" />
    <input type="hidden" id="y1" name="y1" />
    <input type="hidden" id="w1" name="w1" />
    <input type="hidden" id="h1" name="h1" /> 
        
    <input type="hidden" name="h_img_url" id="h_img_url" value="<?php echo $company_detail[0]->img; ?>" />        
    <input type="hidden" name="h_img_thumb_url" id="h_img_thumb_url" value="<?php echo $company_detail[0]->img_thumb; ?>" />
		<input type="hidden" name="h_id" id="h_id" value="<?php echo $id;?>" />
		<input type="submit" name="btn_Save" id="btn_Save" value="Lưu" style="width:70px;" class="button" />&nbsp;
		<input type="button" name="btn_GoBack" id="btn_GoBack" value="Quay lại" style="width:70px;" class="button" onclick="history.go(-1); return false;" />
	</td>
  </tr>
</table>
</form>